﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.Xml;
namespace HeavenvsDarkness
{
    public class MyMenuItem : VisibleGameEntity
    {
        float scaleChosen;

        public float ScaleChosen
        {
            get { return scaleChosen; }
            set { scaleChosen = value; }
        }

        float defaultScale;

        public float DefaultScale
        {
            get { return defaultScale; }
            set { defaultScale = value; }
        }
      
        public MyMenuItem(XmlElement element)
        {
            Items = new List<VisibleGameEntity>();
            Vector3 _Position;   
            Scale = float.Parse(element.GetAttribute("Scale"));
            DefaultScale = Scale;
            ScaleChosen = float.Parse(element.GetAttribute("ScaleChosen"));
            SpeedMove = float.Parse(element.GetAttribute("SpeedMove"));
            _Position.X = float.Parse(element.GetAttribute("X"));
            _Position.Y = float.Parse(element.GetAttribute("Y"));
            _Position.Z = float.Parse(element.GetAttribute("Z"));
            Position = _Position;
            MySprite spriteMenu = new MySprite(element);
            Items.Add(spriteMenu);
            DestPost = Position;
            
        }

        public override void Update(GameTime gameTime)
        {
            if (DestPost != Position)
            {
                MoveTo(DestPost,SpeedMove);
            }           
            base.Update(gameTime);
            UpdateProperties();
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);
        }

        public void SetDefaultScale()
        {
            this.SetScale(DefaultScale);
        }

        public void SetChosenScale()
        {
            this.SetScale(ScaleChosen);
        }

        public Boolean isClicked()
        {
            return false;
        }
        

    }
}
